if (this._contentPRE) { // double content? } else { this._contentPRE = <HTMLPreElement>child; } }​ } this.fullPath = parentPath + '/' + this.name;​ this._createChildNodesAndSort(childLIs);​ }​​ private _createChildNodesAndSort(childLIs: HTMLLIElement[]) { for (var i = 0; i < childLIs.length; i++) { var node = new Node(this.fullPath, childLIs[i]); if (node.isDir) { this._insertChildNode(this._subDirs, node, <any>this._files.length); } else { this._insertChildNode(this._subDirs, node, false); } } }​ private _insertChildNode(nodeList: Node[], node: Node, forceRerootingEvenIfOrdered: boolean) { // TODO: binary search var appendLast = !nodeList.length || node.name > nodeList[nodeList.length - 1].name; } }}